import request from '@/utils/request'

// 分页查询报销记录
export const getReimbursementList = (params) => {
  return request({
    url: '/admin/reimbursement/page',
    method: 'get',
    params
  })
}
// 分页查询报销记录
export const getReimbursementListData = (params) => {
  return request({
    url: '/admin/reimbursement/page/data',
    method: 'get',
    params
  })
}

// 新增报销记录
export const addReimbursement = (data) => {
  return request({
    url: '/admin/reimbursement',
    method: 'post',
    data
  })
}

// 修改报销记录
export const updateReimbursement = (data) => {
  return request({
    url: '/admin/reimbursement',
    method: 'put',
    data
  })
}

// 删除报销记录
export const deleteReimbursement = (id) => {
  return request({
    url: `/admin/reimbursement/${id}`,
    method: 'delete'
  })
}

// 审核报销记录
export const auditReimbursement = (id, status, auditComment) => {
  return request({
    url: `/admin/reimbursement/audit/${id}`,
    method: 'post',
    params: { status, auditComment }
  })
}

// 根据ID获取报销记录详情
export const getReimbursementById = (id) => {
  return request({
    url: `/admin/reimbursement/${id}`,
    method: 'get'
  })
}
